<%@ page language="java" contentType="text/html; charset=UTF-8"
		 pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="tag" tagdir="/WEB-INF/tags" %>
<c:set var="ctx" value="${pageContext.request.contextPath}" />

<!DOCTYPE html>
<html>
<tag:head title="图书类别管理" ctx="${ctx}">
	<link href="${ctx}/assets/css/admin/admin_role_list/style.css" rel="stylesheet">	<!-- 该页面特定的样式 -->
</tag:head>

<tag:body>
	<!-- 左 上 导航 -->
	<tag:nav ctx="${ctx}"></tag:nav>

	<!-- page content -->
	<div class="right_col" role="main">
		<div class="">
			<div class="clearfix"></div>

			<div class="row">
				<div class="col-md-12 col-sm-12 col-xs-12">
					<div class="x_panel">
						<div class="x_title">
							<h2>图书类别列表</h2>
							<ul class="nav navbar-right panel_toolbox">
								<li>
									<button type="button" class="btn btn-success"><i class="fa fa-user-plus">
									</i> 添加图书类别
									</button>
								</li>
								<li>
									<button type="button" class="btn btn-danger" data-toggle="modal"
											data-target=".bs-example-modal-dbg"><i class="fa fa-trash-o"></i>删除选定
									</button>
								</li>
							</ul>
							<div class="clearfix"></div>
						</div>
						<div class="x_content">
							<table id="datatable-checkbox" class="table table-striped table-bordered bulk_action">
								<thead>
								<tr>
									<th width="5%"><input type="checkbox" id="check-all"></th>
									<th width="7%">ID</th>
									<th width="10%">类别名称</th>
									<th width="10%">操作</th>
								</tr>
								</thead>

								<tbody>
								<c:forEach var="bookClass" items="${requestScope.bookClasses}">
									<tr>
										<td width="5%"><input type="checkbox"  name="table_records"/></td>
										<td width="7%">${bookClass.bookClassId}</td>
										<td width="10%">${bookClass.name}</td>
										<td width="25%">
											<a href='#' class='btn btn-info btn-xs' onclick='editBookClass(this)'><i class='fa fa-pencil'></i> 编辑 </a>
											<a href='#' class='btn btn-danger btn-xs' data-toggle='modal' data-target='.bs-example-modal-db' onclick='deleteBookClassInfo(this)'>
												<i class='fa fa-pencil'></i>
												删除
											</a>

										</td>
									</tr>
								</c:forEach>
								</tbody>
							</table>
							<div class="dataTables_paginate paging_simple_numbers" id="datatable-checkbox_paginate">
								<ul class="pagination">
									<li class="paginate_button previous disabled" id="datatable-checkbox_previous">
										<a href="javascript:void(0)" aria-controls="datatable-checkbox" data-dt-idx="0" tabindex="0">上一页</a>
									</li>
									<li class="paginate_button next disabled" id="datatable-checkbox_next">
										<a href="javascript:void(0)" aria-controls="datatable-checkbox" data-dt-idx="2" tabindex="0">下一页</a>
									</li>
								</ul>
							</div>
						</div>
					</div>
				</div>

			</div>


		</div>
	</div>
	<!-- /page content -->

	<!-- footer content -->
	<tag:footer></tag:footer>
</tag:body>
<!-- javascript -->
<tag:javascript ctx="${ctx}">
	<!-- this page -->
	<script src="${ctx}/assets/js/admin/admin_bookClass_list/admin_bookClass_list.js"></script>
	<script>
		<c:if test="${requestScope.error != null}">
		createPNotify("提示信息","error","${requestScope.error}");
		</c:if>
		//初始化表格
		initTable();
		<c:choose>
		<c:when test="${requestScope.page.pageSize == 10 || requestScope.page.pageSize == 50 || requestScope.page.pageSize == 25 || requestScope.page.pageSize == 100}">
		$("#pageSize").val(${requestScope.page.pageSize});
		</c:when>
		<c:otherwise>
		$("#pageSize").val("all");
		</c:otherwise>
		</c:choose>
		createPaging($('#datatable-checkbox_paginate'),${requestScope.page.currentPageNum},${requestScope.page.totalPageNum},'bookClassList(this)',10);
		adjustPagination($("#datatable-checkbox_paginate").children("ul"),${requestScope.page.currentPageNum},${requestScope.page.totalPageNum});
	</script>
</tag:javascript>
</html>

<!-- start:删除图书类别 -->
<div class="modal fade bs-example-modal-db" tabindex="-1" role="dialog" aria-hidden="true">
	<div class="modal-dialog modal-sm">
		<div class="modal-content">

			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
						aria-hidden="true">×</span>
				</button>
				<h4 class="modal-title">删除图书</h4>
			</div>
			<div class="modal-body">
				<h4>确定删除选定的？</h4>
			</div>
			<div class="form-group">
				<label class="control-label col-md-3 col-sm-3 col-xs-12"></label>
				<div class="col-md-6 col-sm-6 col-xs-12">
					<h4 class="info">成功或失败提示</h4>
				</div>
			</div>
			<div class="modal-footer">
				<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
				<button type="button" class="btn btn-primary">确定</button>
			</div>

		</div>
	</div>
</div>
<!-- end:删除图书类别 -->

<!-- start:删除多个图书类别 -->
<div class="modal fade bs-example-modal-dbg" tabindex="-1" role="dialog" aria-hidden="true">
	<div class="modal-dialog modal-sm">
		<div class="modal-content">

			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
						aria-hidden="true">×</span>
				</button>
				<h4 class="modal-title" id="myModalLabel2">删除图书</h4>
			</div>
			<div class="modal-body">
				<h4>确定删除选定的？</h4>
			</div>
			<div class="form-group">
				<label class="control-label col-md-3 col-sm-3 col-xs-12"></label>
				<div class="col-md-6 col-sm-6 col-xs-12">
					<h4 class="info">成功或失败提示</h4>
				</div>
			</div>
			<div class="modal-footer">
				<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
				<button type="button" class="btn btn-primary">确定</button>
			</div>

		</div>
	</div>
</div>
<!-- end:删除多个图书类别 -->

